<!DOCTYPE html>
<!--
Template Name: Metronic - Responsive Admin Dashboard Template build with Twitter Bootstrap 3.1.1
Version: 2.0.2
Author: KeenThemes
Website: http://www.keenthemes.com/
Contact: support@keenthemes.com
Purchase: http://themeforest.net/item/metronic-responsive-admin-dashboard-template/4021469?ref=keenthemes
License: You must have a valid license purchased only from themeforest(the above link) in order to legally use the theme for your project.
-->
<!--[if IE 8]>
<html lang="en" class="ie8 no-js">
    <![endif]-->
    <!--[if IE 9]>
    <html lang="en" class="ie9 no-js">
        <![endif]-->
        <!--[if !IE]>
        <!-->
        <!--<![endif]-->
        <!-- BEGIN HEAD -->
        <!-- BEGIN BODY -->
<link rel="stylesheet" href="./assets/css/site.css"/>
<link rel="stylesheet" type="text/css" href="./assets/css/ownOnlineStationDetail.css">
<body>

<div class="site_content">
        <div class="content_box">
            <div class="detail_info">
                <!-- <div class="location">

                </div> -->
                <div class="detail_content">

                	<div class="draw_img siteInfo" style=" width: 100%;overflow: hidden;">
                	<div class="left" style="width: 100%;">
                		<div class="title">站点实况</div>
                		<div class="container-fluid siteInfo">
                			<div class="row total" ng-if="!!ACPileStatusList&&ACPileStatusList.length>0">
                				<span ng-bind="ACPileStatusList.length"></span>交流(<span ng-bind="ACPileFreeCount"></span>空闲)
                			</div>
                			<div class="row">
                				<div class="col-md-2" ng-repeat="ACPileStatus in ACPileStatusList">
                					<ul>
                						<li>
                                        <span ng-bind="ACPileStatus.charger_id"></span>
                                        <span>交流</span>
                                        </li>
                						<li ng-if="ACPileStatus.online_status==0" class="darkBlue">离线中</li>
                						<li ng-if="ACPileStatus.online_status==1" ng-class="{green:ACPileStatus.charge_status==0,
                                            yellow:ACPileStatus.charge_status==1,
                                            blue:ACPileStatus.charge_status==2,
                                            grey:ACPileStatus.charge_status==3}"
                                            ng-bind="ACPileStatus.charge_status | getValueInStaticFilter : 'chargeStatusArray'"></li>
                					</ul>
                				</div>
                			</div>




        			 <div class="row total " ng-if="!!DCPileStatusMap&&DCPileStatusMap.length>0">
                				<span ng-bind="DCPileStatusMap.length"></span>直流(<span ng-bind="DCPileFreeCount"></span>空闲)
                			</div>
                			<div class="row AC-allInfo">
                				<div class="col-md-4" ng-repeat="DCPileStatus in DCPileStatusMap.DCPileStatusList">
                					<ul>
                						<li class="text-left">
                                            <span ng-bind="DCPileStatus.charger_id"></span>
                                            <span>直流</span>
                                        </li>
                						<li class="text-left col-md-12" style="padding: 0;">

                                            <div ng-class="{'col-md-4':DCPileStatus.portList.length==3,
                                            'col-md-6':DCPileStatus.portList.length==2,
                                            'col-md-12':DCPileStatus.portList.length==1,
                                            green:port.online_status==1 && port.charge_status==0,
                                            yellow:port.online_status==1 && port.charge_status==1,
                                            blue:port.online_status==1 && port.charge_status==2,
                                            grey:port.online_status==1 && port.charge_status==3,
                                            darkBlue:port.online_status==0}"
                                            ng-repeat="port in DCPileStatus.portList track by $index">
                                            <span  ng-class="{green:port.online_status==1 && port.charge_status==0,
                                            yellow:port.online_status==1 && port.charge_status==1,
                                            blue:port.online_status==1 && port.charge_status==2,
                                            grey:port.online_status==1 && port.charge_status==3,
                                            darkBlue:port.online_status==0}"
                                            ng-bind="$index | getValueInStaticFilter : 'chargeInterfaceArray'"></span>
                                            <span ng-if="port.online_status==0">离线中</span>
                                            <span ng-if="port.online_status==1" ng-bind="port.charge_status | getValueInStaticFilter : 'chargeStatusArray'"></span>
                                            <span ng-bind="port.soc"
                                            ng-if="port.online_status==1 && port.charge_status==2"></span>
                                            </div>
                						</li>
                					</ul>
                				</div>

                				<!-- <div class="col-md-4">
                					<ul>
                						<li class="text-left"><span>1#</span><span>交流</span></li>
                						<li class="green text-left col-md-12" style="padding: 0;">
                							<div class="col-md-6 blue"><span class="blue">A</span><span>充电中</span><span>75%</span></div>
                							<div class="col-md-6 yellow"><span class="yellow">B</span><span>已预约</span></div>
                						</li>
                					</ul>
                				</div>
                				<div class="col-md-4">
                					<ul>
                						<li class="text-left"><span>1#</span><span>交流</span></li>
                						<li class="green text-left col-md-12" style="padding: 0;">
                							<div class="col-md-6 blue"><span class="blue">C</span><span>充电中 </span><span>75%</span></div>
                							<div class="col-md-6 green"><span class="green">B</span><span>空闲中</span></div>
                						</li>
                					</ul>
                				</div> -->



                			</div>
                		</div>

                	</div>

                </div>



                    <div class="info_data">
                        <div class="info" ng-model="self_height">
                            <div class="title">
                                <div class="left"><span>电站信息</span></div>
                                <div class="right-pic">
                                    <a  data-target="#uploading"
                                        data-toggle="modal" ng-click="initUpload();">添加图片</a>
                                    <a id="slidetoggle" >展示图片</a>
                                        <a  id="btn_add_char" href="javascript:;"  data-target="#allotChargerManage" ng-click="allotChargerManage();"
										data-toggle="modal"> 添加电桩</a>
                                        <a id="btn_update_site"
                                        data-target="#stationLocationList"
                                        data-toggle="modal" ng-click="stationLocationManage();">坐标管理</a>
                                        <a id="btn_update_site"
                                        data-target="#modStationModel"
                                        data-toggle="modal" ng-click="updateStation();">修改</a>
                                        <a  ng-click="deleteStation(stationDetailInfo.station_id);"> 删除</a>

                                    </div>
                                <div class="cb">
                                </div>
                            </div>

                            <div class="content" style="position: relative;">
                                <div id="content_sh" ng-if="imgesList.length>0">
                                    <ul class="sh-img">
                                        <li ng-repeat="imge in imgesList">
                                          <p class="del_bg"><a class="del" ng-click="deletePhoto(this.imge);"></a></p>
                                          <span class="sh-span">
                                               <img ng-src="{{imge}}"  data-toggle="modal"/>
                                          </span>
                                        </li>
                                    </ul>
                                </div>

                                <!-- showing images modal -->
                <div class="modal fade" id="imgModal" tabindex="-1" role="dialog"  aria-labelledby="myModalLabel" aria-hidden="true">
								   <div class="modal-dialog">
								      <div class="modal-content">
								       <div class="modal-body">
								       	    <img class="pic-frame" style="width: 300px;"/>
                                        </div>
							     	   </div>
							     	</div>
							  </div>
                                <ul class="ul_one">
                                	<li>
                                        <div style="width: 100%;">
                                            <b><span>站点名称：</span></b>
                                            <span ng-bind="stationDetailInfo.station_name"></span>
                                        </div>
                                        <div>
                                            <b><span>站点充电类型：</span></b>
                                            <span ng-bind="stationDetailInfo.station_type | getValueInStaticFilter : 'chargerTypeArray'"></span>
                                        </div>
                                    </li>
                                    <li>
                                        <div style="width: 100%;">
                                            <b><span>站点描述：</span></b>
                                            <span ng-bind="stationDetailInfo.describes"></span>
                                        </div>
                                    </li>
                                    <li>
                                        <div style="width: 100%;">
                                            <b><span>详细地址：</span></b>
                                            <span ng-bind="stationDetailInfo.address"></span>
                                        </div>
                                    </li>
                                    <li>
                                        <div>
                                            <b><span>所在商圈/楼盘：</span></b>
                                            <span ng-bind="stationDetailInfo.circle | sliceSubString"></span>
                                        </div>
                                        <div>
                                            <b><span>支持对外开放：</span></b>
                                            <span ng-bind="stationDetailInfo.is_allow_open | getValueInStaticFilter : 'whetherArray'"></span>
                                        </div>
                                    </li>
                                    <li>
                                       	<div>
                                            <b><span>充电运营服务商：</span></b>
                                            <span ng-bind="stationDetailInfo.oper_name"></span>
                                        </div>
                                        <div>
                                            <b><span>合作商：</span></b>
                                            <span ng-bind="stationDetailInfo.name"></span>
                                        </div>
                                    </li>
                                    <li>
                                        <div>
                                            <b><span>所在城市：</span></b>
                                            <span ng-bind="stationDetailInfo.district_name"></span>
                                        </div>
                                        <div>
                                            <b><span>停车处位置：</span></b>
                                            <span ng-bind="stationDetailInfo.parking_type | getValueInStaticFilter : 'parkingTypeArray'"></span>
                                        </div>

                                    </li>
                                    <li>
                                        <div>
                                            <b><span>直流桩数量：</span></b>
                                            <span ng-bind="stationDetailInfo.direct_num"></span>
                                        </div>
                                        <div>
                                            <b><span>交流桩数量：</span></b>
                                            <span ng-bind="stationDetailInfo.alternate_num"></span>
                                        </div>
                                    </li>
                                    <li>
                                        <div>
                                            <b><span>建立时间：</span></b>
                                            <span ng-bind="stationDetailInfo.establish_time | date:'yyyy-MM-dd' "></span>
                                        </div>
                                        <div>
                                            <b><span>当前状态：</span></b>
                                            <span ng-bind="stationDetailInfo.current_state | getValueInStaticFilter : 'currentStateArray'"></span>
                                        </div>
                                    </li>

                                </ul>
                            </div>
                        </div>
                        <charge-data-summary station_id="stationId">
                        </charge-data-summary>
                        <div class="cb"></div>
                    </div>















                    <div class="draw_img">
                            <charge-summary station_id="stationId">
                            </charge-summary>
                            <reserve-summary station_id="stationId">
                            </reserve-summary>
                        </div>
                    <div class="cb"></div>
                    <style>
                        #table_id_filter{position: static;float: left;margin:10px 10px 10px 0;}
                    </style>
                    <div class="draw_img" style="overflow: hidden;">
                        <div class="left charDataChange table_box bg-white">
                            <div class="title">电桩列表</div>
                            <div class="cb"></div>
                            <div>
                                <table class="table table-striped table-bordered table-hover" id="table_1">
								<thead>
								<tr>
    						        <th>电桩ID</th>
                                    <th>电桩类型</th>
                                    <th>站内编号</th>
                                    <th>二维码编号</th>
                                    <th>电桩状态</th>
                                    <th>操作</th>
								</tr>


								</thead>
								<tbody>
									<tr ng-repeat="ACP in ACPileList track by $index" on-loaded="{{$last}}" target-table="table_1">
									        <td>
                                                <span ng-bind="ACP.charger_id"></span>
                                            </td>
                                            <td>
                                                <span ng-bind="ACP.charger_type | getValueInStaticFilter : 'stationTypeArray' "></span>
                                            </td>
                                            <td>
                                                <span ng-bind="ACP.serial_no"></span>
                                            </td>
                                            <td>
                                                <span ng-bind="ACP.qr_code"></span>
                                            </td>
                                            <td>
                                                <span ng-repeat="chargeStatus in ACP.chargeStatusList track by $index" ng-class="{greenFont:chargeStatus==0,
                                                yellowFont:chargeStatus==1,
                                                blueFont:chargeStatus==2,
                                                gredFont:chargeStatus==3,
                                                darkBlueFont:chargeStatus==8}">
                                                    {{$index | getValueInStaticFilter : 'chargeInterfaceArray' }}
                                                    {{chargeStatus | getValueInStaticFilter : 'chargeStatusArray' }}
                                                    <span ng-if="!$last">/</span>
                                                </span>
                                            </td>
                                            <td style="padding: 0">
                                                <a class="btn" data-target="#" href="javascript:;"
                                                ng-click="selectChargerInfo(ACP);">
                                                    查看
                                                </a>
                                            </td>
								</tr>
								</tbody>
							</table>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>


    <div id="modStationModel" class="modal fade" role="dialog" aria-hidden="true" data-backdrop="false">
        <div class="modal-dialog"  style="width:1000px">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
                    <h4 class="modal-title">电站信息修改</h4>
                </div>
                <form class="w5c-form demo-form" role="form" w5c-form-validate="vm.validateOptions" novalidate name="validateForm">
                <div class="modal-body form">
                    <div class="form-group">
                        <div class="row">
                            <label class="col-sm-2 control-label text-right muted"><span class="star-color">* </span>站点名称</label>
                            <div class="col-sm-4">
                                <div class="input-group">
                                    <input type="text" class="form-control" ng-model="modifyStationInfo.station_name" name="station_name" required="" ng-maxlength="32" ng-pattern='/^[^\\/\:\*\?"<>\|]*$/'/>

                                </div>
                            </div>
                         <label class="col-sm-2 control-label text-right"><span class="star-color"></span>站点充电类型</label>
                        <div class="col-sm-4">
                            <div class="input-group">
                                <select ng-model="modifyStationInfo.station_type" class="form-control" name="station_type">
                                    <option value="">请选择当前状态</option>
                                    <option value="1">直流</option>
                                    <option value="2">交流</option>
                                    <option value="3">混合</option>
                                </select>
                            </div>
                        </div>
                        </div>
                        <div class="row">
                            <label class="col-sm-2 control-label text-right"><span class="star-color"></span>详细地址</label>
                            <div class="col-sm-4">
                                <div class="input-group">
                                    <input type="text" class="form-control" ng-model="modifyStationInfo.address" name="address" ng-maxlength="100"/>
                                </div>
                            </div>
                            <label class="col-sm-2 control-label text-right">所在商圈/楼盘</label>
                            <div class="col-sm-4">
                                <div class="input-group"><input type="text" class="form-control" ng-model="modifyStationInfo.circle" name="circle"  ng-maxlength="128"/></div>
                            </div>
                        </div>
                        <div class="row">
                            <label class="col-sm-2 control-label text-right"><span class="star-color">* </span>当前状态</label>
                            <div class="col-sm-4">
                                <div class="input-group">
                                <select ng-model="modifyStationInfo.current_state" class="form-control" name="current_state" required="">
                                    <option value="">请选择当前状态</option>
                                    <option value="1">运营中</option>
                                    <option value="2">安装中</option>
                                    <option value="3">规划中</option>
                                </select>
                                </div>
                            </div>
                            <label class="col-sm-2 control-label text-right"><span class="star-color"></span>是否支持开放</label>
                            <div class="col-sm-4">
                                <div class="input-group">
                                    <select ng-model="modifyStationInfo.is_allow_open" class="form-control" name="is_allow_open">
                                        <option value="">请选择是否支持开放</option>
                                        <option value="1">是</option>
                                        <option value="0">否</option>
                                    </select>
                                </div>
                            </div>
                        </div>
                        <div class="row">
                            <label class="col-sm-2 control-label text-right"><span class="star-color">* </span>充电运营服务商</label>
                            <div class="col-sm-4">
                                <div class="input-group">
                                <select class="form-control"
                                    ng-options="operMechant.oper_merchant_id as operMechant.oper_name for operMechant in operMechantList "
                                    ng-model="modifyStationInfo.oper_merchant_id" name="oper_merchant_id" required="">
                                    <option value="">请选择服务商</option>
                                </select>
                                </div>
                            </div>
                            <label class="col-sm-2 control-label text-right">合作商</label>
                                              <div class="col-sm-4">
                                                <div class="input-group">
                                                  <select class="form-control"
                                                  ng-options="merchant.merchant_id as merchant.name for merchant in merchantList "
                                                  ng-model="modifyStationInfo.entity_id" id="selectEntity">
                                                  <option value="">请选择商户</option>
                                                  </select>
                                                </div>
                                              </div>
                        </div>

                        <div class="row">
                            <label class="col-sm-2 control-label text-right">停车处位置</label>
                            <div class="col-sm-4">
                                <div class="input-group">
                                    <select ng-model="modifyStationInfo.parking_type" class="form-control" name="parking_type" >
                                        <option value="">请选择停车处位置</option>
                                        <option value="1">停车楼</option>
                                        <option value="2">室外</option>
                                        <option value="3">地下室</option>
                                    </select>
                                </div>
                            </div>
                            <label class="col-sm-2 control-label text-right"><span class="star-color"></span>所在位置</label>
                            <div class="col-sm-4">
                                <div class="input-group"><input type="text" class="form-control" ng-model="modifyStationInfo.parking_addr" name="parking_addr" ng-maxlength="100"/></div>
                            </div>
                        </div>

                    <div class="row">
                            <label class="col-sm-2 control-label text-right"><span class="star-color">* </span>所在城市</label>
                            <div class="col-sm-10" style="padding-left: 7px">
                                <div class="input-group">
                                    <district-select
                                      area-list="areaList"
                                      city-list="cityList"
                                      district-list="districtList"
                                      selected-area="selectedArea"
                                      selected-city="selectedCity"
                                      selected-district="selectedDistrict"
                                      has-init-value="hasInitValue">
                                    </district-select>
                                </div>
                            </div>
                    </div>
                    <div class="row">
                            <label class="col-sm-2 control-label text-right"><span class="star-color">* </span>建立时间</label>
                            <div class="col-sm-4">
                                <div class="input-group">
                                    <input class="form-control getTime"  type="text" ng-readonly="true"
                                    ng-model="modifyStationInfo.establish_time" required=""/>
                                </div>
                            </div>
                            <label class="col-sm-2 control-label text-right">站点描述</label>
                            <div class="col-sm-4">
                                <div class="input-group">
                                    <textarea class="form-control" rows="3" ng-model="modifyStationInfo.describes">
                                    </textarea>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="modal-footer" >
                    <button type="button" class="btn btn-danger" data-dismiss="modal"><i class="fa fa-times"></i>关闭</button>
                    <button type="button" class="btn btn-primary" w5c-form-submit="modifyOwnOnlineStation();"><i class="fa fa-check"></i>保存</button>
                </div>
                </form>
            </div>
        </div>
    </div>
    <div id="allotChargerManage" class="modal fade" role="dialog" aria-hidden="true" data-backdrop="false" >
        <div class="modal-dialog" style="width:1000px">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal"
                        aria-hidden="true">×</button>
                    <h4 class="modal-title">【
                                <span ng-bind="stationDetailInfo.station_name"></span>】
                                站分配电桩管理</h4>
                </div>

                <div class="modal-body form">

                    <div class="form-group">

                        <table class="table table-striped table-bordered table-hover"
                            id="table_2">
                            <thead>
                                <tr>

                                    <th>桩ID</th>
<!--                                     <th>桩所在地</th> -->
                                    <th>运营二维码</th>
                                    <th>操作</th>
                                </tr>
                            </thead>
                            <tbody>
                                <tr class="odd gradeX"
                                    ng-repeat="charger in chargerList  track by $index"
                                    on-loaded="{{$last}}" target-table="table_2">
                                    <td>
                                        <span ng-bind="charger.charger_id"></span>
                                    </td>
<!--                                     <td>
                                        <span ng-bind="charger.station_name"></span>
                                    </td> -->
                                    <td>
                                        <span ng-bind="charger.qr_code"></span>
                                    </td>
                                    <td>
                                        <a class="btn" href="javascript:;"
                                        data-toggle="modal" ng-click="bindPile(charger.charger_id);">
                                            添加
                                        </a>
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                    </div>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-danger" data-dismiss="modal">
                        <i class="fa fa-times"></i>关闭
                    </button>
                </div>
            </div>
        </div>
    </div>

    <div id="uploading" class="modal fade" role="dialog" aria-hidden="true" data-backdrop="false">
        <div class="modal-dialog"  style="width:1000px">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal"
                        aria-hidden="true" ng-click="deleteImages();">×</button>
                    <h4 class="modal-title">图片上传</h4>
                </div>
                <div class="modal-content">
                        <div class="row" id="addImg">
                        </div>
                </div>
            </div>
        </div>
    </div>

    <div id="stationLocationList" class="modal fade" role="dialog" aria-hidden="true" data-backdrop="false" >
                          <div class="modal-dialog" style="width:1000px">
                            <div class="modal-content">
                              <div class="modal-header">
                                <button type="button" class="close" data-dismiss="modal"
                                  aria-hidden="true">×</button>
                                <h4 class="modal-title">
                                【
                                <span ng-bind="stationDetailInfo.station_name"></span>】
                                站坐标管理
                                </h4>
                              </div>

                              <div class="modal-body form">

                                <div class="form-group">
                                  <div class="table_btn_box">
                                    <a id="addSubmit" class="btn blue" href="javascript:;"  data-target="#stationLocationModel"
                                      data-toggle="modal" ng-click="addStationLocation();">
                                      <i class="fa fa-plus"></i>
                                        新增
                                    </a>
                                  </div>
                                  <table class="table table-striped table-bordered table-hover" id="table_3">
                                    <thead>
                                      <tr>
                                        <th>地图类型</th>
                                        <th>经度</th>
                                        <th>纬度</th>
                                        <th>是否启用</th>
                                        <th>操作</th>
                                      </tr>
                                    </thead>
                                    <tbody>
                                      <tr class="odd gradeX" ng-repeat="stationLocation in stationLocationList  track by $index" on-loaded="{{$last}}" target-table="table_3">
                                        <td>
                                          <span ng-bind="stationLocation.coordtype | getValueInStaticFilter : 'locationArray'"></span>
                                        </td>
                                        <td>
                                          <span ng-bind="stationLocation.coordinate_x"></span>
                                        </td>
                                        <td>
                                          <span ng-bind="stationLocation.coordinate_y"></span>
                                        </td>
                                        <td>
                                            <span ng-bind="stationLocation.valid_flag  | getValueInStaticFilter : 'validArray'"></span>
                                        </td>
                                        <td>
                                          <a class="btn" href="javascript:;"  data-target="#stationLocationModel"
                                          data-toggle="modal" ng-click="updateStationLocation(stationLocation);">
                                            修改
                                          </a>
                                        </td>
                                      </tr>
                                    </tbody>
                                    </table>
                                </div>
                              </div>
                              <div class="modal-footer">
                                <button type="button" class="btn btn-danger" data-dismiss="modal">
                                  <i class="fa fa-times"></i>关闭
                                </button>
                              </div>
                            </div>
                          </div>
    </div>
    <div id="stationLocationModel" class="modal fade" role="dialog" aria-hidden="true" data-backdrop="false">
                          <div class="modal-dialog">
                          <div class="modal-content">
                          <div class="modal-header">
                          <button ng-click="validateForm.reset()" type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
                          <h4 class="modal-title" ng-if="'insert'==modifyType">新增站点坐标</h4>
                          <h4 class="modal-title" ng-if="'update'==modifyType">修改站点坐标</h4>
                          </div>
                          <form class="w5c-form demo-form" role="form"
                        w5c-form-validate="vm.validateOptions" novalidate name="validateForm">
                          <div class="modal-body form">
                          <div class="form-group">
                          <div class="row">
                            <label class="col-sm-2 control-label text-right"><span class="star-color">* </span>类型</label>
                            <div class="col-sm-10">
                              <div class="input-group">
                                <div class="col-md-8 location-left">
                                  <div class="radio-list">
                                    <label  class="radio-inline col-md-4" style="margin:0px;padding: 0px" ng-if="'update'==modifyType||!!!hasGaoDe">
                                      <input ng-model="stationLocationModel.coordtype" type="radio"  value="1" ng-disabled="'update'==modifyType"
                                      ng-selected="stationLocationModel.coordtype==1">
                                        高德地图
                                    </label>
                                    <label  class="radio-inline col-md-4" style="margin:0px;padding: 0px" ng-if="'update'==modifyType||!!!hasBaidu">
                                      <input ng-model="stationLocationModel.coordtype" type="radio"  value="2" ng-disabled="'update'==modifyType"
                                      ng-selected="stationLocationModel.coordtype==2">
                                        百度地图
                                    </label>
                                  </div>
                                </div>

                              </div>
                            </div>
                          </div>
                          <div class="row">
                            <label class="col-sm-2 control-label text-right"><span class="star-color">* </span>经度</label>
                            <div class="col-sm-10">
                              <div class="input-group">
                                <input type="text" class="form-control " key="required" ng-model="stationLocationModel.coordinate_x" required="" name="coordinate_x" ng-pattern="/^[\-\+]?(0?\d{1,2}\.\d{1,10}|1[0-7]?\d{1}\.\d{1,10}|180\.0{1,10})$/" ng-maxlength="64" placeholder="请输入-180至180的数字，至少输入一位小数">
                              </div>
                            </div>
                          </div>
                          <div class="row">
                            <label class="col-sm-2 control-label text-right"><span class="star-color">* </span>纬度</label>
                            <div class="col-sm-10">
                              <div class="input-group">
                                <input type="text" class="form-control " key="required" ng-model="stationLocationModel.coordinate_y" name="coordinate_y" required="" ng-pattern="/^[\-\+]?([0-8]?\d{1}\.\d{1,10}|90\.0{1,10})$/" ng-maxlength="64" placeholder="请输入-90至90的数字，至少输入一位小数"/>
                              </div>
                            </div>
                          </div>                          
                          <div class="row" ng-if="'insert'!=modifyType">
                            <label class="col-sm-3 control-label text-right"><span class="star-color">* </span>是否启用</label>
                            <div class="col-md-8">
                              <div class="radio-list">
                                <label  class="radio-inline col-md-4" style="margin:0px;padding: 0px">
                                  <input ng-model="stationLocationModel.valid_flag" type="radio"  value="1"
                                  ng-selected="stationLocationModel.valid_flag==1">
                                    启用
                                </label>
                                <label  class="radio-inline col-md-4" style="margin:0px;padding: 0px">
                                  <input ng-model="stationLocationModel.valid_flag" type="radio"  value="0"
                                  ng-selected="stationLocationModel.valid_flag==0">
                                    停用
                                </label>
                              </div>
                            </div>
                          </div>
                          </div>
                          </div>
                          <div class="modal-footer">
                          <button type="button" class="btn btn-danger" data-dismiss="modal" ng-click="validateForm.reset()"><i class="fa fa-times"></i>关闭</button>
                          <button type="button" class="btn btn-primary" w5c-form-submit="modifyStationLocation();"><i class="fa fa-check"></i>保存</button>
                          </div>
                          </form>
                          </div>
                          </div>
                        </div>
</body>
<script>
$('.getTime').datetimepicker({
language: 'zh-CN',
pickTime: false,
todayBtn: true,
autoclose: true,
minView: '2',
forceParse: false,
format: "yyyy-mm-dd"
});</script>
<script type="text/javascript">
function initUpload(stationId){
    var $ = jQuery,    // just in case. Make sure it's not an other libaray.

    $wrap = $('#uploader'),

    // 图片容器
    $queue = $('<ul class="filelist"></ul>')
        .appendTo( $wrap.find('.queueList') ),

    // 状态栏，包括进度和控制按钮
    $statusBar = $wrap.find('.statusBar'),

    // 文件总体选择信息。
    $info = $statusBar.find('.info'),

    // 上传按钮
    $upload = $wrap.find('.uploadBtn'),

    // 没选择文件之前的内容。
    $placeHolder = $wrap.find('.placeholder'),

    // 总体进度条
    $progress = $statusBar.find('.progress').hide(),

    // 添加的文件数量
    fileCount = 0,

    // 添加的文件总大小
    fileSize = 0,

    // 优化retina, 在retina下这个值是2
    ratio = window.devicePixelRatio || 1,

    // 缩略图大小
    thumbnailWidth = 110 * ratio,
    thumbnailHeight = 110 * ratio,

    // 可能有pedding, ready, uploading, confirm, done.
    state = 'pedding',

    // 所有文件的进度信息，key为file id
    percentages = {},

    supportTransition = (function(){
        var s = document.createElement('p').style,
            r = 'transition' in s ||
                  'WebkitTransition' in s ||
                  'MozTransition' in s ||
                  'msTransition' in s ||
                  'OTransition' in s;
        s = null;
        return r;
    })(),

    // WebUploader实例
    uploader;

    if ( !WebUploader.Uploader.support() ) {
    bootboxWindow.alert('Web Uploader 不支持您的浏览器！如果你使用的是IE浏览器，请尝试升级 flash 播放器', null);
    throw new Error( 'WebUploader does not support the browser you are using.' );
    }
    uploader = null;
    // 实例化
    uploader = WebUploader.create({
    pick: {
        id: '#filePicker',
        label: '点击选择图片'
    },
    // dnd: '#uploader .queueList',
    // paste: document.body,

    accept: {
        title: 'Images',
        extensions: 'gif,jpg,jpeg,bmp,png',
        mimeTypes: 'image/*'
    },

    // swf文件路径
    swf: './assets/scripts/upload/Uploader.swf',

    disableGlobalDnd: false,

    chunked: true,
    // server: 'http://webuploader.duapp.com/server/fileupload.php',
    server: '/cms/file/upload?entity_tbl=oms_station&entity_id='+stationId,
    fileNumLimit: 5,
    fileSizeLimit: 10 * 1024 * 1024,    // 200 M
    fileSingleSizeLimit: 10 * 1024 * 1024    // 50 M
    });

    // 添加“添加文件”的按钮，
    uploader.addButton({
    id: '#filePicker2',
    label: '继续添加'
    });

    // 当有文件添加进来时执行，负责view的创建
    function addFile( file ) {
    var $li = $( '<li id="' + file.id + '">' +
            '<p class="title">' + file.name + '</p>' +
            '<p class="imgWrap"></p>'+
            '<p class="progress"><span></span></p>' +
            '</li>' ),

        $btns = $('<div class="file-panel">' +
            '<span class="cancel">删除</span>' +
            '<span class="rotateRight">向右旋转</span>' +
            '<span class="rotateLeft">向左旋转</span></div>').appendTo( $li ),
        $prgress = $li.find('p.progress span'),
        $wrap = $li.find( 'p.imgWrap' ),
        $info = $('<p class="error"></p>'),

        showError = function( code ) {
            switch( code ) {
                case 'exceed_size':
                    text = '文件大小超出';
                    break;

                case 'interrupt':
                    text = '上传暂停';
                    break;

                default:
                    text = '上传失败，请重试';
                    break;
            }

            $info.text( text ).appendTo( $li );
        };

    if ( file.getStatus() === 'invalid' ) {
        showError( file.statusText );
    } else {
        // @todo lazyload
        $wrap.text( '预览中' );
        uploader.makeThumb( file, function( error, src ) {
            if ( error ) {
                $wrap.text( '不能预览' );
                return;
            }

            var img = $('<img src="'+src+'">');
            $wrap.empty().append( img );
        }, thumbnailWidth, thumbnailHeight );

        percentages[ file.id ] = [ file.size, 0 ];
        file.rotation = 0;
    }

    file.on('statuschange', function( cur, prev ) {
        if ( prev === 'progress' ) {
            $prgress.hide().width(0);
        } else if ( prev === 'queued' ) {
            $li.off( 'mouseenter mouseleave' );
            $btns.remove();
        }

        // 成功
        if ( cur === 'error' || cur === 'invalid' ) {
            console.log( file.statusText );
            showError( file.statusText );
            percentages[ file.id ][ 1 ] = 1;
        } else if ( cur === 'interrupt' ) {
            showError( 'interrupt' );
        } else if ( cur === 'queued' ) {
            percentages[ file.id ][ 1 ] = 0;
        } else if ( cur === 'progress' ) {
            $info.remove();
            $prgress.css('display', 'block');
        } else if ( cur === 'complete' ) {
            $li.append( '<span class="success"></span>' );
        }

        $li.removeClass( 'state-' + prev ).addClass( 'state-' + cur );
    });

    $li.on( 'mouseenter', function() {
        $btns.stop().animate({height: 30});
    });

    $li.on( 'mouseleave', function() {
        $btns.stop().animate({height: 0});
    });

    $btns.on( 'click', 'span', function() {
        var index = $(this).index(),
            deg;

        switch ( index ) {
            case 0:
                uploader.removeFile( file );
                return;

            case 1:
                file.rotation += 90;
                break;

            case 2:
                file.rotation -= 90;
                break;
        }

        if ( supportTransition ) {
            deg = 'rotate(' + file.rotation + 'deg)';
            $wrap.css({
                '-webkit-transform': deg,
                '-mos-transform': deg,
                '-o-transform': deg,
                'transform': deg
            });
        } else {
            $wrap.css( 'filter', 'progid:DXImageTransform.Microsoft.BasicImage(rotation='+ (~~((file.rotation/90)%4 + 4)%4) +')');
            // use jquery animate to rotation
            // $({
            //     rotation: rotation
            // }).animate({
            //     rotation: file.rotation
            // }, {
            //     easing: 'linear',
            //     step: function( now ) {
            //         now = now * Math.PI / 180;

            //         var cos = Math.cos( now ),
            //             sin = Math.sin( now );

            //         $wrap.css( 'filter', "progid:DXImageTransform.Microsoft.Matrix(M11=" + cos + ",M12=" + (-sin) + ",M21=" + sin + ",M22=" + cos + ",SizingMethod='auto expand')");
            //     }
            // });
        }


    });

    $li.appendTo( $queue );
    }

    // 负责view的销毁
    function removeFile( file ) {
    var $li = $('#'+file.id);

    delete percentages[ file.id ];
    updateTotalProgress();
    $li.off().find('.file-panel').off().end().remove();
    }

    function updateTotalProgress() {
    var loaded = 0,
        total = 0,
        spans = $progress.children(),
        percent;

    $.each( percentages, function( k, v ) {
        total += v[ 0 ];
        loaded += v[ 0 ] * v[ 1 ];
    } );

    percent = total ? loaded / total : 0;

    spans.eq( 0 ).text( Math.round( percent * 100 ) + '%' );
    spans.eq( 1 ).css( 'width', Math.round( percent * 100 ) + '%' );
    updateStatus();
    }

    function updateStatus() {
    var text = '', stats;

    if ( state === 'ready' ) {
        text = '选中' + fileCount + '张图片，共' +
                WebUploader.formatSize( fileSize ) + '。';
    } else if ( state === 'confirm' ) {
        stats = uploader.getStats();
        if ( stats.uploadFailNum ) {
            text = '已成功上传' + stats.successNum+ '张图片，'+
                stats.uploadFailNum + '张图片上传失败，<a class="retry" href="#">重新上传</a>失败图片'
        }

    } else {
        stats = uploader.getStats();
        text = '共' + fileCount + '张（' +
                WebUploader.formatSize( fileSize )  +
                '），已上传' + stats.successNum + '张';

        if ( stats.uploadFailNum ) {
            text += '，失败' + stats.uploadFailNum + '张';
        }
    }

    $info.html( text );
    }

    function setState( val ) {
    var file, stats;

    if ( val === state ) {
        return;
    }

    $upload.removeClass( 'state-' + state );
    $upload.addClass( 'state-' + val );
    state = val;

    switch ( state ) {
        case 'pedding':
            $placeHolder.removeClass( 'element-invisible' );
            $queue.parent().removeClass('filled');
            $queue.hide();
            $statusBar.addClass( 'element-invisible' );
            uploader.refresh();
            break;

        case 'ready':
            $placeHolder.addClass( 'element-invisible' );
            // $( '#filePicker2' ).removeClass( 'element-invisible');
            $queue.parent().addClass('filled');
            $queue.show();
            $statusBar.removeClass('element-invisible');
            uploader.refresh();
            break;

        case 'uploading':
            // $( '#filePicker2' ).addClass( 'element-invisible' );
            $progress.show();
            $upload.text( '暂停上传' );
            break;

        case 'paused':
            $progress.show();
            $upload.text( '继续上传' );
            break;

        case 'confirm':
            $progress.hide();
            // $upload.text( '开始上传' ).addClass( 'disabled' );
            $upload.text( '开始上传' );
            stats = uploader.getStats();
            if ( stats.successNum && !stats.uploadFailNum ) {
                setState( 'finish' );
                return;
            }
            break;
        case 'finish':
            stats = uploader.getStats();
            if ( stats.successNum ) {
                bootboxWindow.alert("上传成功", null);
            } else {
                // 没有成功的图片，重设
                state = 'done';
                location.reload();
            }
            break;
    }

    updateStatus();
    }

    uploader.onUploadProgress = function( file, percentage ) {
    var $li = $('#'+file.id),
        $percent = $li.find('.progress span');

    $percent.css( 'width', percentage * 100 + '%' );
    percentages[ file.id ][ 1 ] = percentage;
    updateTotalProgress();
    };

    uploader.onFileQueued = function( file ) {
    fileCount++;
    fileSize += file.size;

    if ( fileCount === 1 ) {
        $placeHolder.addClass( 'element-invisible' );
        $statusBar.show();
    }

    addFile( file );
    setState( 'ready' );
    updateTotalProgress();
    };

    uploader.onFileDequeued = function( file ) {
    fileCount--;
    fileSize -= file.size;

    if ( !fileCount ) {
        setState( 'pedding' );
    }

    removeFile( file );
    updateTotalProgress();

    };

    uploader.on( 'all', function( type ) {
    var stats;
    switch( type ) {
        case 'uploadFinished':
            setState( 'confirm' );
            break;

        case 'startUpload':
            setState( 'uploading' );
            break;

        case 'stopUpload':
            setState( 'paused' );
            break;

    }
    });

    uploader.onError = function( code ) {
    console.log(code);
    bootboxWindow.alert('错误提示： ' + code, null);
    };

    $upload.on('click', function() {
    if ( $(this).hasClass( 'disabled' ) ) {
        return false;
    }

    if ( state === 'ready' ) {
        uploader.upload();
    } else if ( state === 'paused' ) {
        uploader.upload();
    } else if ( state === 'uploading' ) {
        uploader.stop();
    }
    });

    $info.on( 'click', '.retry', function() {
    uploader.retry();
    } );

    $info.on( 'click', '.ignore', function() {
    bootboxWindow.alert('todo', null);
    } );

    $upload.addClass( 'state-' + state );
    updateTotalProgress();
}
</script>
<script type="text/javascript">
    $(document).ready(function(){
$("#slidetoggle").click(function(){
        if(!!$("#content_sh")){
            $("#content_sh").slideToggle();
            }
            $("#content_sh img").click(function(){
                $("#imgModal img").attr("src", $(this).attr("src"));
                $("#imgModal").modal();
            });  
        });

    })
</script>
</html>
